package com.chat.net.socket;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;

public class SocketChannelContext implements ChannelContext{
    Socket socket;
    InputStream inputStream;
    OutputStream outputStream;
//    Object handledDate;//被handler处理过的数据

    public SocketChannelContext(Socket socket) throws IOException {
        this.socket = socket;
        inputStream = socket.getInputStream();
        outputStream = socket.getOutputStream();
    }

    @Override
    public Socket getSocket() {
        return socket;
    }

    @Override
    public OutputStream getOutputStream() {
        return outputStream;
    }

    @Override
    public InputStream getInputStream() {
        return inputStream;
    }

//    @Override
//    public Object getHandledDate() {
//        return handledDate;
//    }
//
//    @Override
//    public void setHandledDate(Object handledDate) {
//            this.handledDate = handledDate;
//    }
}
